using AdminSG3L.Domain.Entities;

namespace AdminSG3L.Domain.Repositories;

/// <summary>
/// 角色仓储接口
/// </summary>
public interface IRoleRepository : IRepository<AppRole>
{
    /// <summary>
    /// 根据角色编码获取角色
    /// </summary>
    /// <param name="roleCode">角色编码</param>
    /// <returns>角色实体</returns>
    Task<AppRole?> GetByCodeAsync(string roleCode);

    /// <summary>
    /// 获取角色及其权限
    /// </summary>
    /// <param name="id">角色ID</param>
    /// <returns>包含权限的角色实体</returns>
    Task<AppRole?> GetWithPermissionsAsync(Guid id);

    /// <summary>
    /// 获取角色及其菜单
    /// </summary>
    /// <param name="id">角色ID</param>
    /// <returns>包含菜单的角色实体</returns>
    Task<AppRole?> GetWithMenusAsync(Guid id);
}
